package quanlydoanvao.func3_9;

import java.util.ArrayList;

import javax.faces.model.SelectItem;

/******************************************
 * Filename			: F3_9TypeSearch.java
 * Description		: 
 * Created date		: Aug 2, 2008
 * Author			: Phonglt
 ******************************************/
public class F3_9TypeSearch {
	private final String frmdefault = "/qldoanvao/func3_9/frmdefault.xhtml";
	private final String frmdate = "/qldoanvao/func3_9/frmdate.xhtml";
	private final String frmgender = "/qldoanvao/func3_9/frmgender.xhtml";
	private final String tbnationlaty = "/qldoanvao/func3_9/tbnationlaty.xhtml";
	private final String tborgan = "/qldoanvao/func3_9/tborgan.xhtml";
	private final String tbplace = "/qldoanvao/func3_9/tbplace.xhtml";
	private final String tbdate = "/qldoanvao/func3_9/tbdate.xhtml";
	private final String tbpurpose = "/qldoanvao/func3_9/tbpurpose.xhtml";
	private final String tbpassportnum = "/qldoanvao/func3_9/tbpassportnum.xhtml";
	private final String tbgender = "/qldoanvao/func3_9/tbgender.xhtml";
	private ArrayList<F3_9TypeInfo> data = new ArrayList<F3_9TypeInfo>();

	public F3_9TypeSearch() {
		this.data.add(new F3_9TypeInfo("quoctich", "Quốc tịch", frmdefault, tbnationlaty));
		this.data.add(new F3_9TypeInfo("coquandenghi", "Cơ quan đề nghị tiếp Đoàn", frmdefault, tborgan));
		this.data.add(new F3_9TypeInfo("diadiemlamviec", "Địa điểm đến làm việc", frmdefault, tbplace));
		this.data.add(new F3_9TypeInfo("ngayden", "Thời gian đến làm việc", frmdate, tbdate));
		this.data.add(new F3_9TypeInfo("linhvucmucdich", "Lĩnh vực/Mục đích", frmdefault, tbpurpose));
		this.data.add(new F3_9TypeInfo("sohc", "Số hộ chiếu", frmdefault, tbpassportnum));
		this.data.add(new F3_9TypeInfo("gioitinh", "Giới tính", frmgender, tbgender));
	}
	
	/**************************************
	 * Method name		: getLabelSearch
	 * Return type		: SelectItem[]
	 * Description		: get Label for combobox
	 * Created date		: Aug 3, 2008
	 * Author			: Phonglt
	 **************************************/
	public SelectItem[] getLabelSearch(){
		SelectItem[] labelItems = new SelectItem[this.data.size()];
		for (int i = 0; i < labelItems.length; i++) {
			labelItems[i] = new SelectItem(i, this.data.get(i).getLabel());
		}
		return labelItems;
	}
	
	/**************************************
	 * Method name		: getFieldSearch
	 * Return type		: String
	 * Description		: return field search to use in SQL
	 * Created date		: Aug 3, 2008
	 * Author			: Phonglt
	 **************************************/
	public String getFieldSearch(int key){
		return this.data.get(key).getFieldSearch();
	}
	
	/**************************************
	 * Method name		: getSrcFormSearch
	 * Return type		: String
	 * Description		: 
	 * Created date		: Aug 3, 2008
	 * Author			: Phonglt
	 **************************************/
	public String getSrcFormSearch(int key){
		return this.data.get(key).getFormSearch();
	}
	
	/**************************************
	 * Method name		: getSrcTableView
	 * Return type		: String
	 * Description		: 
	 * Created date		: Aug 3, 2008
	 * Author			: Phonglt
	 **************************************/
	public String getSrcTableView(int key){
		return this.data.get(key).getTableView();
	}
}
